Skip to content

Conversation

@jgray-19
Copy link
Collaborator

@jgray-19 jgray-19 commented Jun 4, 2025

Breaking change - Now it forces all tables to be references. So lists that were previously transferred need the .eval(), which does a shallow copy.

Updated documentation and examples.

Closes #20

Needs a release of MAD-NG to be merged.

@jgray-19 jgray-19 requested a review from Copilot June 4, 2025 15:00

This comment was marked as outdated.

@jgray-19 jgray-19 requested a review from Copilot June 5, 2025 14:49

This comment was marked as outdated.

@jgray-19 jgray-19 requested a review from Copilot June 6, 2025 10:10
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a breaking change in the MAD-NG API to require that all table transfers be made by reference, with an option to perform a shallow copy using eval(), along with corresponding updates to documentation, examples, and workflows. Key changes include:

  • Updating MAD-NG function calls (e.g. recv_vars, send) to include the new shallow_copy/true parameter.
  • Renaming variables and updating file paths in examples to fix typos.
  • Updating version numbers, changelogs, and workflow scripts to reflect the new MAD-NG release.

Reviewed Changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/pymadng/madp_classes.py Updated calls to MAD-NG with shallow_copy and modified send commands.
src/pymadng/init.py Updated version from 0.6.3 to 0.7.0.
examples/runall.py Corrected example file paths.
examples/ex-recv-lhc/ex-defexpr.py Improved formatting and added explicit receive keys in recv calls.
examples/ex-ps-twiss/ex-ps-twiss.py Fixed variable naming and enhanced type assertion.
examples/ex-managing-refs/ex-managing-refs.py Corrected directory name and updated reference usage.
examples/ex-lhc-couplingLocal/ex-lhc-couplingLocal.py Removed chrom flag; fixed misnamed variables and improved output messaging.
examples/ex-fodo/ex-fodos.py Fixed typos in directory names and improved formatting.
examples/ex-benchmark-and-fork/ex-benchmark-and-fork.py Updated MAD commands and fixed variable naming inconsistencies.
examples/ex-LowLevel/ex-send-recv.py Reformatted send calls and adjusted message parameters for data transfer.
examples/ex-LowLevel/ex-send-multypes.py Reformatted send calls, updated variable naming, and improved None comparisons.
docs/quickstartguide.md Updated code examples to reflect API changes.
docs/examples.rst Revised literalinclude paths for updated example files.
docs/ex-lhc-couplingLocal.rst Updated file references and example excerpts.
docs/contributing.md Revised documentation guidelines for descriptive naming.
docs/communication.md Updated literalinclude directives with new line ranges.
docs/advanced_features.md Modified example syntax to match updated API usage.
CHANGELOG.md Documented the breaking changes and new features for version 0.7.0.
.github/workflows/test-pymadng.yml Updated MAD binary versions in workflow.
.github/workflows/python-publish.yml Updated MAD binary versions in workflow.
Comments suppressed due to low confidence (1)

examples/ex-LowLevel/ex-send-recv.py:57

  • The comment for setting 'cm4' indicates a multiplication factor of 1, yet the code is using a multiplier of 2. Please update the comment to accurately describe the operation.
mad.send(cmatrixString.format("cm4", "*", 2)) # Set cm4 to cm1 * 1 and send it to Python

@jgray-19 jgray-19 merged commit a27e663 into main Jun 6, 2025
11 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Send python dicts to MAD-NG

2 participants